#ifndef __SHMIPC_SHARED_MEMORY_H__
#define __SHMIPC_SHARED_MEMORY_H__

#include <pthread.h>
#include <cstdint>
#include <string>

#include "shmipc/core/xresult.h"

namespace shmipc::core {


using SharedMemory = void*;


XResult<SharedMemory> ShmAlloc(const std::string& name, uint32_t size);
XResult<SharedMemory> ShmAttach(const std::string& name);
XResult<void*>        ShmBuffer(const SharedMemory shm);
XResult<uint32_t>     ShmBufferSize(const SharedMemory shm);

XResult<void> ShmFree(SharedMemory shm);



} //namespace shmipc::core


#endif /** !__SHMIPC_SHARED_MEMORY_H__ */